Skip to content

Add unit tests for androidContainerUtility validation and command execution#2724

Merged
ConnorQi01 merged 3 commits into
masterfrom
dev/v-peq/issue-2711-androidContainerUtility_tests
Jun 22, 2026
Merged

Add unit tests for androidContainerUtility validation and command execution#2724
ConnorQi01 merged 3 commits into
masterfrom
dev/v-peq/issue-2711-androidContainerUtility_tests

Conversation

@ConnorQi01

Copy link
Copy Markdown
Collaborator

Summary

Add a dedicated unit test file for androidContainerUtility.ts covering input validation, error classification, and the run-as to su fallback logic.

Proposed Changes

  • Add test/extension/android/androidContainerUtility.test.ts
  • Cover validateAppName: valid names resolve, invalid characters reject
  • Cover validateFilePath: valid paths resolve, .. traversal and forbidden characters reject
  • Cover validateFileContent: content without quotes resolves, content with double quotes rejects
  • Cover _executeCommandWithRunner: RunAsError for not an application / not debuggable, generic Error for not permitted
  • Cover _push fallback: run-as failure escalates to su, original RunAsError rethrown when su also fails

Test Plan

  • npm test passes (230 passing, 0 failing)

Closes #2711

@ConnorQi01

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ConnorQi01

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@ConnorQi01 ConnorQi01 merged commit 4aa2fc9 into master Jun 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add unit tests for androidContainerUtility validation and command execution logic

2 participants